<template>
  <el-row :gutter="24">
    <el-col :span="12">
      <el-card shadow="never" ref="card1" :class="[ 'overflow-card', computedClass('card1') ]">
        <div slot="header" style="text-align: center">
          <span>执行对象</span>
        </div>
        <ul>
          <li
            class="mb10"
            v-for="(item,index) in mdl.evalPlanExecutorList"
            :key="index"
          >{{ Number(index+1) + '.' }} {{item.name}}</li>
        </ul>
      </el-card>
    </el-col>
    <el-col :span="12">
      <el-card shadow="never" ref="card2" :class="[ 'overflow-card', computedClass('card2') ]">
        <div slot="header" style="text-align: center">
          <span>考评对象</span>
        </div>
        <ul>
          <li
            class="mb10"
            v-for="(item,index) in mdl.evalPlanTargetList"
            :key="index"
          >{{ Number(index+1) + '.' }} {{item.name}}</li>
        </ul>
      </el-card>
    </el-col>
  </el-row>
</template>

<script>
export default {
  data() {
    return {
      mdl: {}
    }
  },
  methods: {
    computedClass(ref) {
      this.$nextTick(() => {
        return this.$refs[ref].$el.offsetHeight > 310 ? 'overY-Scroll' : ''
      })
    },
    show(obj) {
      console.log(obj)
      this.mdl = obj
    }
  }
}
</script>
